[%#
  # IMPORTANT NOTE
  #   This documentation is generated automatically from source
  #   templates.  Any changes you make here may be lost.
  # 
  #   The 'docsrc' documentation source bundle is available for download
  #   from http://www.template-toolkit.org/docs.html and contains all
  #   the source templates, XML files, scripts, etc., from which the
  #   documentation for the Template Toolkit is built.
-%]
[% META book = 'Library'
        page = 'Splash'
%]
[%  WRAPPER toc;
	PROCESS tocitem 
	        title ="DESCRIPTION"
                subs  = [
                    "Introduction",
		    "Configuration",
		    "Colours",
		    "Style"
		];
	PROCESS tocitem 
	        title ="COMPONENT TEMPLATES"
                subs  = [
                    "splash/text",
		    "splash/table",
		    "splash/row",
		    "splash/cell",
		    "splash/box",
		    "splash/button",
		    "splash/bar",
		    "splash/hair",
		    "splash/menu",
		    "splash/menubar",
		    "splash/panel",
		    "splash/pane",
		    "splash/tab",
		    "splash/tabset",
		    "splash/tabbox",
		    "splash/tabsbox",
		    "splash/tabspanel"
		];
	PROCESS tocitem 
	        title ="EXAMPLES"
                subs  = [];
	PROCESS tocitem 
	        title ="AUTHOR"
                subs  = [];
	PROCESS tocitem 
	        title ="VERSION"
                subs  = [];
	PROCESS tocitem 
	        title ="COPYRIGHT"
                subs  = [];
	PROCESS tocitem 
	        title ="SEE ALSO"
                subs  = [];
    END
%]
<!-- Pod to HTML conversion by the Template Toolkit version 2 -->
[% WRAPPER section
    title="DESCRIPTION"
-%]<p>
<b>NOTE:</b> This documentation is incomplete, incorrect and outdated.
The Splash! library is still evolving and subject to change.  See
the examples for a much more recent and accurate demonstration of
use.
</p>
[% WRAPPER subsection
   title = "Introduction"
-%]<p>
The 'Splash' template library is distributed as part of the Template
Toolkit.  It can be found in the 'templates' sub-directory of the
installation directory.
</p>
<pre>    /your/tt2/installation
    |
    +-- docs
    |      ...
    |  
    +-- images
    |      ...
    |
    +-- examples
    |      ...
    |
    +-- templates
        |
        +-- html
        |      ...
        +-- pod
        |      ...
        +-- splash     &lt;&lt;&lt;&lt; YOU ARE HERE
               ...</pre>
<p>
To use the Splash library, you first need to tell the Template Toolkit
where to find the template files.
</p>
<pre>    use Template;</pre>
<pre>    my $tt2 = Template-&gt;new({
	INCLUDE_PATH =&gt; '/usr/local/tt2/templates',
    });</pre>
<p>
For a portable way to determine the installation 'templates' directory,
you can use the <code>'Template::Config-&gt;instdir()'</code> class method.
</p>
<pre>    use Template;</pre>
<pre>    my $tt2 = Template-&gt;new({
	INCLUDE_PATH =&gt; Template::Config-&gt;instdir('templates'),
    });</pre>
<p>
Note that you should set the INCLUDE_PATH to the 'templates' directory
as shown here and don't be tempted to set the INCLUDE_PATH to
'templates/splash'.  Many of the Splash! components use elements in
the 'html' directory and contain directives of the form:
</p>
<pre>    [% tt_start_tag %] INCLUDE html/something [% tt_end_tag %].</pre>
[%- END %]
[% WRAPPER subsection
   title = "Configuration"
-%]<p>
The 'splash/config' template defines a 'splash' hash array which
contains numerous configuration items for the Splash library.  You
must PROCESS this template to ensure that the hash definition is
imported into your calling template.  An INCLUDE is not sufficient as
it localises variables and prevents the 'splash' hash array from
existing outside the splash/config template.
</p>
<pre>    [% tt_start_tag %] PROCESS splash/config [% tt_end_tag %]</pre>
<p>
Alternately, you can define the splash/config template as a PRE_PROCESS
item when you create the Template processor. 
</p>
<pre>    use Template;</pre>
<pre>    my $tt2 = Template-&gt;new({
	INCLUDE_PATH =&gt; Template::Config-&gt;instdir('templates'),
	PRE_PROCESS  =&gt; 'splash/config',
    });</pre>
<p>
You can modify the default configuration by creating your own
PRE_PROCESS config file which loads the 'splash/config' and then
tweaks the settings to your own preferences.
</p>
<pre>    my $tt2 = Template-&gt;new({
	INCLUDE_PATH =&gt; [ '/home/abw/tt2/templates',
		          Template::Config-&gt;instdir('templates') ],
        PRE_PROCESS =&gt; 'config'
    });</pre>
<p>
/home/abw/tt2/templates/config:
</p>
<pre>    [% tt_start_tag %] # load the 'splash' configuration
       PROCESS splash/config;
       
       # tweak values to personal preferences
       splash.images       = '/~abw/tt2/images/splash'
       splash.select.col   = 'leaf'
       splash.unselect.col = 'bud'
    [% tt_end_tag %]</pre>
<p>
The splash/config file includes some instructional comments on 
things you might like to tweak.
</p>
[%- END %]
[% WRAPPER subsection
   title = "Colours"
-%]<p>
The Splash! library uses the colours defined in the html/rgb template.
The 'rgb' hash defined therein is imported as the 'splash.rgb' hash.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/box col='grey75' [% tt_end_tag %]</pre>
<p>
See the examples for further enlightenment on using colour.
</p>
[%- END %]
[% WRAPPER subsection
   title = "Style"
-%]<p>
There are two very primitive &quot;styles&quot; implemented called &quot;select&quot; and
&quot;unselect&quot;.  These are used to indicate which item on a menu is
selected, for example.  Each style defines characteristics like
background colour, font face, size and colour, text alignment, and so
on.  
</p>
<p>
The styles are implemented as hashes within the 'splash' hash.  Many
of the components respond to a 'style' variable being set and you can
pass a direct reference to splash.select or splash.unselect (or your
own styles).  e.g.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/button 
	   content = &quot;Unselected&quot;
           style   = splash.unselect
    [% tt_end_tag %]
    [% tt_start_tag %] INCLUDE splash/button 
           content =&quot;Selected&quot;
           style   = splash.select
    [% tt_end_tag %]</pre>
<p>
Alternately, you can use the 'select' variable to indicate either
of the inbuilt styles: splash.select or splash.unselect.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/button 
           content = &quot;Unselected&quot;
           select  = 0
    [% tt_end_tag %]
    [% tt_start_tag %] INCLUDE splash/button
           content = &quot;Selected&quot;
           select  = 1
    [% tt_end_tag %]</pre>
[%- END %]
[%- END %]
[% WRAPPER section
    title="COMPONENT TEMPLATES"
-%]<p>
This section describes some of the component templates in the Splash!
library.  This documentation is incomplete and may also be inaccurate
in places.  The examples in the 'examples' directory are likely to be
a much better reference.
</p>
[% WRAPPER subsection
   title = "splash/text"
-%]<p>
Simple template to format text according to a selected/unselected style,
adding links, etc.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/text
           content = 'Template Toolkit'
           link    = 'http://www.template-toolkit.org'
           select  = 0
           bold    = 1
    [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Text content.
</p>

<li><b>link</b><br>
<p>
URL which can be defined to make the text a link.
</p>

<li><b>style</b><br>
<p>
Reference to a style hash.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>font (style.font.face)</b>
<li><b>bold (style.font.bold)</b>
<li><b>size (style.font.size)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/table"
-%]<p>
A thin wrapper around html/table, allowing a colour to be specified
by name.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/table
           col   = 'aqua'
	   pad   = 4
           width = '100%'
    [% tt_end_tag %]
    &lt;tr&gt;
      &lt;td&gt;Foo&lt;/td&gt;
      &lt;td&gt;Bar&lt;/td&gt;
    &lt;/tr&gt;
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Table content.
</p>

<li><b>col</b><br>
<p>
Background colour.
</p>

<li><b>border</b><br>
<p>
Border width (default: 0)
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>pad</b><br>
<p>
Cell padding.
</p>

<li><b>space</b><br>
<p>
Cell padding.
</p>

</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/row"
-%]<p>
Creates a row for an HTML table.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/table [% tt_end_tag %]</pre>
<pre>       [% tt_start_tag %] WRAPPER splash/row col='marine' [% tt_end_tag %]
       &lt;td&gt;Foo&lt;/td&gt;&lt;td&gt;Bar&lt;/td&gt;
       [% tt_start_tag %] END [% tt_end_tag %]</pre>
<pre>       [% tt_start_tag %] WRAPPER splash/row col='aqua' [% tt_end_tag %]
       &lt;td&gt;Foo&lt;/td&gt;&lt;td&gt;Bar&lt;/td&gt;
       [% tt_start_tag %] END [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Row content.
</p>

<li><b>col</b><br>
<p>
Background colour.
</p>

<li><b>valign</b><br>
<p>
Vertical alignment
</p>

<li><b>rowspan</b><br>
<p>
Number of rows to span.
</p>

</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/cell"
-%]<p>
Creates a cell for an HTML table.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/table + splash/row + splash/cell col='grey75' [% tt_end_tag %]
	Hello World
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Cell content.
</p>

<li><b>col</b><br>
<p>
Background colour.
</p>

<li><b>align</b><br>
<p>
Horizontal alignment
</p>

<li><b>colspan</b><br>
<p>
Number of columns to span.
</p>

</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/box"
-%]<p>
A box created from a union of splash/table, splash/row and splash/cell.
The following is equivalent to the previous example.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/box col='grey75' [% tt_end_tag %]
	Hello World
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Configuration items are as per the individual templates.
</p>
[%- END %]
[% WRAPPER subsection
   title = "splash/button"
-%]<p>
Creates a small button with rounded corners.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/button
           content = 'Template Toolkit'
           select  = 1
           width   = '50%'
    [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Button content.
</p>

<li><b>style</b><br>
<p>
Reference to a style hash.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>textcol (style.col.text)</b>
<li><b>font (style.font.face)</b>
<li><b>size (style.font.size)</b>
<li><b>bold (style.font.bold)</b>
<li><b>width (style.button.width)</b>
<li><b>align (style.button.align)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/bar"
-%]<p>
Creates a bar with rounded corners at either the top or bottom, and 
square corners on the other.  Default has rounded at the top, set
'invert' to select bottom.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/bar
           content = 'Hello World',
           select  = 1
    [% tt_end_tag %]	</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Bar content.
</p>

<li><b>style</b><br>
<p>
Reference to a style hash.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>invert</b><br>
<p>
Flag to invert bar to hang down instead of sitting
upright.
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>textcol (style.col.text)</b>
<li><b>font (style.font.face)</b>
<li><b>size (style.font.size)</b>
<li><b>bold (style.font.bold)</b>
<li><b>width (style.button.width)</b>
<li><b>align (style.button.align)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/hair"
-%]<p>
Generates a frame enclosing the content within crosshair corners.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/hair
           content = 'Template Toolkit'
    [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Hair content.
</p>

<li><b>style</b><br>
<p>
Reference to a style hash.
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>bgcol (style.col.back)</b>
<li><b>align (style.button.align)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/menu"
-%]<p>
Creates a menu as a series of splash/button elements.
</p>
<pre>    [% tt_start_tag %] buttons = [ 
	  { text =&gt; 'One', link =&gt; 'one.html' }
          { text =&gt; 'Two', link =&gt; 'two.html' }
       ]
    [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] INCLUDE splash/menu
           select = 2		# Two
    [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>buttons</b><br>
<p>
A reference to a list of hash arrays containing 'text' and 'link' items.
</p>

<li><b>select (n or 0)</b><br>
<p>
Indicates which button should be selected.  First item is 1.  0 indicates
no button selected.
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>align</b><br>
<p>
Horizontal alignment
</p>

</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/menubar"
-%]<p>
As above, but incorporated into a wider bar.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/menubar [% tt_end_tag %]
       Section Title
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>buttons</b><br>
<p>
A reference to a list of hash arrays containing 'text' and 'link' items.
</p>

<li><b>select (n or 0)</b><br>
<p>
Indicates which button should be selected.  First item is 1.  0 indicates
no button selected.
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>align</b><br>
<p>
Horizontal alignment
</p>

</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/panel"
-%]<p>
A table with a coloured edge.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/panel edge='black' fill='grey75' border=2 [% tt_end_tag %]
       &lt;tr&gt;
         &lt;td&gt;Hello World&lt;/td&gt;
       &lt;/tr&gt;
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Panel content.
</p>

<li><b>style</b><br>
<p>
Reference to a style hash.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>align</b><br>
<p>
Horizontal alignment
</p>

<li><b>border</b><br>
<p>
Border width (default: 0)
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>edge (style.col.edge)</b>
<li><b>fill (style.col.fill)</b>
<li><b>pad (style.pad)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/pane"
-%]<p>
A union of splash/row + splash/cell.
</p>
<pre>    [% tt_start_tag %] WRAPPER splash/panel select=1 [% tt_end_tag %]
       [% tt_start_tag %] WRAPPER splash/pane col='grey75' [% tt_end_tag %]
          Hello World
       [% tt_start_tag %] END [% tt_end_tag %]</pre>
<pre>       [% tt_start_tag %] WRAPPER splash/pane col='grey50' [% tt_end_tag %]
          Hello Again
       [% tt_start_tag %] END [% tt_end_tag %]
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "splash/tab"
-%]<p>
A simple button looking like a page tab.
</p>
<pre>    [% tt_start_tag %] INCLUDE splash/tab
           content = 'Option 1'
           col = 'aqua'
    [% tt_end_tag %]</pre>
<p>
Configuration items:
</p>
<ul>
<li><b>content</b><br>
<p>
Tab content.
</p>

<li><b>style</b><br>
<p>
Reference to a style hash.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>align</b><br>
<p>
Horizontal alignment
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>textcol (style.col.text)</b>
<li><b>font (style.font.face)</b>
<li><b>size (style.font.size)</b>
<li><b>bold (style.font.bold)</b>
<li><b>tabalign (style.tab.align)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/tabset"
-%]<p>
A set of splash/tab components, similar to a menu.
</p>
<p>
Configuration items:
</p>
<ul>
<li><b>tabs</b><br>
<p>
List of hash references containing text/link entries, as per 
menu buttons.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>invert</b><br>
<p>
Flag to invert tab to hang down instead of sitting
upright.
</p>

</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/tabbox"
-%]<p>
Add a splash/tab to the top of a splash/box.
</p>
<p>
Configuration items:
</p>
<ul>
<li><b>title</b><br>
<pre> title.</pre>

<li><b>content</b><br>
<pre> content.</pre>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>tabwidth</b><br>
<p>
Width of tabs.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>border</b><br>
<p>
Border width (default: 0)
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>fill (style.col.fill)</b>
<li><b>tabalign (style.tab.align)</b>
<li><b>tablocate (style.tab.locate)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/tabsbox"
-%]<p>
Add a splash/tabset to the top of a splash/box.
</p>
<p>
Configuration items:
</p>
<ul>
<li><b>tabs</b><br>
<p>
List of hash references containing text/link entries, as per 
menu buttons.
</p>

<li><b>select</b><br>
<p>
Flag to default the style to splash.select (select == true value) or
splash.unselect (select == false value).
</p>

<li><b>content</b><br>
<pre> content.</pre>

<li><b>width</b><br>
<p>
Width in absolute pixels (e.g. '100') or as a percentage (e.g. '50%').
</p>

<li><b>border</b><br>
<p>
Border width (default: 0)
</p>

<li><b>invert</b><br>
<p>
Flag to invert  to hang down instead of sitting
upright.
</p>

</ul>
<p>
The following items default to the relevant style values:
</p>
<ul>
<li><b>col (style.col.text)</b>
<li><b>fill (style.col.fill)</b>
<li><b>tabalign (style.tab.align)</b>
<li><b>tablocate (style.tab.locate)</b>
</ul>
[%- END %]
[% WRAPPER subsection
   title = "splash/tabspanel"
-%]<p>
As per splash/tabsbox, but attached to a splash/panel instead of a
splash/box.
</p>
[%- END %]
[%- END %]
[% WRAPPER section
    title="EXAMPLES"
-%]<p>
See the examples in the 'examples' sub-directory of the installation 
for comprehensive examples showing use of the Splash! library.
</p>
[%- END %]
[% WRAPPER section
    title="AUTHOR"
-%]<p>
Andy Wardley &lt;abw@wardley.org&gt;
</p>
<p>
[% ttlink('http://wardley.org/', 'http://wardley.org/') -%]
</p>
[%- END %]
[% WRAPPER section
    title="VERSION"
-%]<p>
2.68, distributed as part of the
Template Toolkit version 2.19, released on 27 April 2007.
</p>
[%- END %]
[% WRAPPER section
    title="COPYRIGHT"
-%]<pre>  Copyright (C) 1996-2007 Andy Wardley.  All Rights Reserved.</pre>
<p>
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
</p>
[%- END %]
[% WRAPPER section
    title="SEE ALSO"
-%]<p>
[% ttlink('Template::Library::HTML', 'Template::Library::HTML') -%]
</p>
[%- END %]



